var 张如涵 = new Pepole("张如涵")
function Pepole(strName)
{
    this.name=strName;
    this.age=1;
    this.ask =function(who,type)
    {
        if(who==this)
        {
           var arr1 =["计算机","旅游","设计"]
           var n = parseInt( Math.random() * 3 )
           return arr1[n]
        }else
        {
            who.teach(type)
        }
       
    }
    this.teach = function(type)
    {
        switch(type)
        {
            case  "感情":
                return "分手"
              break;""
            case  "专业":
              return "计算机"
            default :
            {
                return "随大流"
            }
        }
    }
}
var 小如 = 张如涵
while(true)
{
  小如.age++                                        
  if(小如.age==18)
  {
    break;
  }
}
var theOthers = new Pepole("其他人")
var r  = 小如.ask(theOthers,"专业")
r  = 小如.ask(小如,"专业")
console.log(r);
r  = 小如.ask(小如,"专业")
console.log(r);
r  = 小如.ask(小如,"专业")
console.log(r);
//------
